<template>
	<div class="d">
		<h1>我是D组件</h1>
		<h4>我有台车：{{car}}</h4>
		<button @click="sendCarToA">把我的车给我叔叔A开一下</button>
	</div>
</template>

<script>
	export default {
		name:'D',
		data() {
			return {
				car:'奔驰'
			}
		},
		/* mounted(){
			console.log(this.x.$on)
		}, */
		methods:{
			sendCarToA(){
				this.$bus.$emit('get-car',this.car)
			}
		}
	}
</script>

<style scoped>
	.d{
		background-color: pink;
		padding: 20px;
	}
</style>